import request from '/@/utils/request';

/**
 * 班级管理
 * @param params 要传的参数值
 * @returns 返回接口数据
 * @method lessonInfo 获取班级信息
 * @method addLessonInfo 添加班级信息
 * @method delLessonInfo 删除班级信息
 * @method getLessonInfo 根据班级名称获取班级信息
 */

export function lessonInfo(params: number) {
	return request({
		url: `lesson?Page=${params}`,
		method: 'get',
	});
}

export function addLessonInfo(params: any) {
	return request({
		url: 'lesson/add',
		method: 'post',
		data: params,
	});
}

export function delLessonInfo(params: any) {
	return request({
		url: 'lesson/delete',
		method: 'delete',
		data: params,
	});
}

export function updateLessonInfo(params: any) {
	return request({
		url: `lesson/update/${params.classId}`,
		method: 'put',
		data: params.className,
	});
}

export function getLessonInfo(params: any) {
	return request({
		url: `lesson?lesson_name=${params}`,
		method: 'get',
	});
}
